//
//  Global.swift
//
//  Created by Python on 2024/6/16.
//

import UIKit

struct Global {
    /// 安全区大小
    static var safeArea: UIEdgeInsets {
        return UIWindow.main.safeAreaInsets
    }

    /// 顶部安全区
    static var safeTop: CGFloat {
        return safeArea.top
    }

    /// 底部安全区
    static var safeBottom: CGFloat {
        return safeArea.bottom
    }

    /// 导航栏高度
    static let navBarHeight: CGFloat = 44.0

    /// 状态栏高度
    static var statusBarHeight: CGFloat {
        if #available(iOS 13.0, *) {
            if let height = UIWindow.main.windowScene?.statusBarManager?.statusBarFrame.height {
                return height
            }
        }
        return UIApplication.shared.statusBarFrame.height
    }

    /// class转string
    static func stringFromClass(_ aClass: AnyClass) -> String {
        return String(describing: aClass)
    }
}
